home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
Pakiet bezpieczenstwa
/
mini Pentoo LiveCD 2006.1
/
mpentoo-2006.1.iso
/
livecd.squashfs
/
etc
/
init.d
/
portmap
< prev
next >
Wrap
Text File
|
2006-01-09
|
1KB
|
49 lines
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-nds/portmap/files/portmap.rc6,v 1.10 2005/03/03 23:24:07 vapier Exp $
depend() {
use net
before inetd
before xinetd
}
start() {
ebegin "Starting portmap"
start-stop-daemon --start --quiet --exec /sbin/portmap -- ${PORTMAP_OPTS}
local ret=$?
eend ${ret}
# without, if a service depending on portmap is started too fast,
# connecting to portmap will fail -- azarah
sleep 1
return ${ret}
}
stop() {
ebegin "Stopping portmap"
start-stop-daemon --stop --quiet --exec /sbin/portmap
eend $?
}
restart() {
# Dump the portmapper's table before stopping
ebegin "Saving portmap table"
local tmpfile=`mktemp /tmp/pmap_table.XXXXXX`
[ -n "$tmpfile" ] && pmap_dump >$tmpfile
eend $? "Error saving portmap table."
# Stop and restart portmapper
svc_stop
sleep 1
svc_start
# Reload the portmapper's table
if [ -n "$tmpfile" ]; then
ebegin "Reloading portmap table"
pmap_set <$tmpfile
eend $? "Error reloading portmap table."
rm -f $tmpfile
fi
}